home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / Amos / SpaceFighter / SPACEFIGHTER.AMOS / SPACEFIGHTER.amosSourceCode < prev    next >
Encoding:
AMOS Source Code  |  1996-02-23  |  25.2 KB  |  857 lines

  1. ' This tutorial is from Mr. AMOS Club
  2. ' issue 5, edited by Brian Bell and
  3. ' others, which folded in 1994.  No
  4. ' other group has matched its code 
  5. ' tutorials before or since. 
  6. '
  7. ' If run on an NTSC system it must 
  8. ' be PAL booted to see the bottom of 
  9. ' the screen.
  10. '
  11. ' ***********************************************************
  12. ' * Welcome to the third part of our SPACEFIGHTER game.     *
  13. ' * This game as you know is our attempt at a Body Blows    *
  14. ' * Street Fighter II style fighting game. I have made      *
  15. ' * drastic changes to the code of this program since       *
  16. ' * issue three where we had one of the fighters doing      *
  17. ' * a few simple movements. That routine was controlled     *
  18. ' * completely from AMAL which made it VERY fast and smooth *
  19. ' * although at the same time VERY complicated and hard     *
  20. ' * to explain.                                             *
  21. ' *                                                         *
  22. ' * This new demo and the full game now use this new        *
  23. ' * system instead as its far more friendly and flexible.   *
  24. ' * Unfortunatley the game nows runs at 25 frames per       *
  25. ' * second instead of the previous 50 frames per second.    *
  26. ' * This is because we are not using the speed of AMAL      *
  27. ' * and we have also opted for half brite mode instead      *
  28. ' * of 32 colour mode which gives us 64 colours on the      *
  29. ' * main game screen instead which allowed Ashley to        *
  30. ' * draw much more detailed backdrops and characters!!      *
  31. ' *                                                         *
  32. ' * Body Blows on the AMIGA runs at 25 frames per second    *
  33. ' * and its only done in 32 colours. Street Fighter II      *
  34. ' * is only 12.5 frames per seond on the AMIGA and its      *
  35. ' * only done in 16 colours! The only game that I have      *
  36. ' * seen that has achieved the 50 frames per second is      *
  37. ' * Mortal Combat which is done in 16 colours.              *
  38. ' *                                                         *
  39. ' * The full SPACEFIGHTER game has 20 new fighters in it    *
  40. ' * which makes it the BIGGEST fighting game around!        *
  41. ' * I have advertised it in AMIGA FORMAT and CU AMIGA       *
  42. ' * for a few months to see how the sales go and I am       *
  43. ' * also working on a coverdisk version as well. The        *
  44. ' * full game costs only ï¿½5.00 to ALL you loyal members.    *
  45. ' * This includes the source code although this is          *
  46. ' * NOT documented as the program is VERY BIG and           *
  47. ' * optimized. I will be explaining LOTS of different       *
  48. ' * routines via MAC and next issue we will have the        *
  49. ' * character fighting another character. I was             *
  50. ' * hoping to have this version on this issue which         *
  51. ' * shows you how to get an intelligent computer            *
  52. ' * controlled opponent. But I have once again ran          *
  53. ' * completely OUT of disk space! The graphics for          *
  54. ' * the SPACEFIGHTER game are VERY big space eaters         *
  55. ' * due to their size and the amount of colours they        *
  56. ' * have.                                                   *
  57. ' *                                                         *
  58. ' * This demo version allows you to do the entire range of  *
  59. ' * movements that this character has.Just move the joystick*
  60. ' * in different directions and press the fire button!!     *
  61. ' * Hold down the fire button for the special move!         *
  62. ' ***********************************************************
  63.  
  64. Hide On : Rem Hide the mouse!
  65.  
  66.  
  67. _____MAIN_____:
  68.  
  69.  
  70. If Length(15)=0 Then Load "tube_planet.pic" : Rem This loads in the packed picture!
  71.  
  72. ' ******************************************************************** 
  73. ' * The next few lines take care of upacking the background picture  * 
  74. ' * and score screen. It fades them in to make it more professional! * 
  75. ' ******************************************************************** 
  76.  
  77. Unpack 15 To 0 : Screen Hide 0
  78. For N=0 To 31 : Colour N,$0 : Next N
  79. Wait Vbl : Screen Show 0
  80. Double Buffer : Update Off 
  81.  
  82. Unpack 10 To 1 : Screen Hide 1
  83. For N=0 To 31 : Colour N,$0 : Next N
  84. Wait Vbl 
  85. Screen Show 1
  86.  
  87. Screen 1
  88. Fade 2 To -1 : Wait 40
  89. Screen 0
  90. Fade 3 To -1 : Wait 40
  91.  
  92.  
  93.  
  94.  
  95.  
  96. ' ************************************************************** 
  97. ' * This variable stores the amount of animations or different * 
  98. ' * movements that our fighter has.                            * 
  99. ' ************************************************************** 
  100.  
  101. AMOUNT_OF_ANIMATIONS=14
  102.  
  103. ' ******************************************************************** 
  104. ' * This next lot of DIM statements store all the numbers that are   * 
  105. ' * used in conjunction with our fighter. Our fighter is cutup into  * 
  106. ' * four different parts. A head, a top body, his legs and a hit     * 
  107. ' * part - which can be any of the previous mentioned. Because       * 
  108. ' * the fighters movements are cutup into smaller pieces to save     * 
  109. ' * memory, speed and disk space we must store the different         * 
  110. ' * combinations that it takes to make each movement up as numbers.  * 
  111. ' * All I have done is store these details in DIM statements.        * 
  112. ' ******************************************************************** 
  113.  
  114. Dim _PL_1_LEGS(AMOUNT_OF_ANIMATIONS)
  115. Dim _PL_1_LEGS_X_OFFSET(AMOUNT_OF_ANIMATIONS)
  116. Dim _PL_1_LEGS_Y_OFFSET(AMOUNT_OF_ANIMATIONS)
  117.  
  118. Dim _PL_1_BODY(AMOUNT_OF_ANIMATIONS)
  119. Dim _PL_1_BODY_X_OFFSET(AMOUNT_OF_ANIMATIONS)
  120. Dim _PL_1_BODY_Y_OFFSET(AMOUNT_OF_ANIMATIONS)
  121.  
  122. Dim _PL_1_HEAD(AMOUNT_OF_ANIMATIONS)
  123. Dim _PL_1_HEAD_X_OFFSET(AMOUNT_OF_ANIMATIONS)
  124. Dim _PL_1_HEAD_Y_OFFSET(AMOUNT_OF_ANIMATIONS)
  125.  
  126. Dim _PL_1_HIT_PART(AMOUNT_OF_ANIMATIONS)
  127. Dim _PL_1_HIT_PART_X_OFFSET(AMOUNT_OF_ANIMATIONS)
  128. Dim _PL_1_HIT_PART_Y_OFFSET(AMOUNT_OF_ANIMATIONS)
  129.  
  130.  
  131. Restore _ANIMATION_DATA
  132.  
  133. For COUNTER=1 To AMOUNT_OF_ANIMATIONS
  134.  
  135. Read _PL_1_LEGS(COUNTER)
  136. Read _PL_1_LEGS_X_OFFSET(COUNTER)
  137. Read _PL_1_LEGS_Y_OFFSET(COUNTER)
  138.  
  139. Read _PL_1_BODY(COUNTER)
  140. Read _PL_1_BODY_X_OFFSET(COUNTER)
  141. Read _PL_1_BODY_Y_OFFSET(COUNTER)
  142.  
  143. Read _PL_1_HEAD(COUNTER)
  144. Read _PL_1_HEAD_X_OFFSET(COUNTER)
  145. Read _PL_1_HEAD_Y_OFFSET(COUNTER)
  146.  
  147. Read _PL_1_HIT_PART(COUNTER)
  148. Read _PL_1_HIT_PART_X_OFFSET(COUNTER)
  149. Read _PL_1_HIT_PART_Y_OFFSET(COUNTER)
  150.  
  151. Next COUNTER
  152.  
  153.  
  154. ' *********************************************************************  
  155. ' * This DATA stores all the information that is required to build up *
  156. ' * the different animations and movements for the character. All I   *
  157. ' * do is store different X and Y offset coardinates of sprite bank   *
  158. ' * images. The character in the game is moved around his X and Y     *
  159. ' * coardinates. Because he is built up of different pieces we must   *  
  160. ' * centre these other pieces around these X and Y coardinates of     *
  161. ' * the fighter. All we have to do is place them at the fighters      *
  162. ' * X and Y coardinate and add an X and Y offset to them that         *
  163. ' * centres the different pieces around him.                          *
  164. ' *********************************************************************
  165.  
  166.  
  167. ' *****************************************************************************
  168. ' * As I have already said the fighter is divided into four different pieces. *  
  169. ' * The following DATA is called in groups of threes. These are the details   *
  170. ' * required by each of the different fighter parts.                          *
  171. ' *                                                                           *
  172. ' * The first number stores an image number which can be anything.            *
  173. ' *                                                                           *
  174. ' * The second number stores an X offset which is added to the fighters X     *
  175. ' * coardinates to centre the image around him.                               *
  176. ' *                                                                           *
  177. ' * The third number stores a Y offset which is added to the fighters y       *
  178. ' * coardinates to centre the image around him.                               *
  179. ' *                                                                           *
  180. ' * The four sets of numbers are stored as follows:-                          *
  181. ' *                                                                           *
  182. ' * The first set I have used for Legs.                                       *
  183. ' * The second set I have used for a top body bit.                            *
  184. ' * The third set I have used for the head.                                   *  
  185. ' * The fourth set I have used for the HIT part.                              *
  186. ' *****************************************************************************
  187.  
  188. _ANIMATION_DATA:
  189. Data 3,0,0,5,-10,-46,1,17,-55,1,-500,-500
  190. Data 4,-6,5,5,-10,-42,1,17,-51,1,-500,-500
  191. Data 18,-4,21,5,-10,-20,1,17,-29,1,-500,-500
  192. Data 16,-3,26,12,-32,1,2,-2,-6,17,20,23
  193. Data 18,-4,21,8,-1,-20,1,17,-29,1,-500,-500
  194. Data 18,-4,21,9,-12,-20,1,17,-29,10,36,-6
  195. Data 11,0,-2,12,-32,-28,2,-2,-34,19,24,-13
  196. Data 4,-6,5,9,-12,-41,1,17,-50,10,36,-27
  197. Data 6,2,0,7,-1,-40,1,24,-50,1,-500,-500
  198. Data 14,8,0,13,-3,-40,1,23,-50,15,45,-48
  199. Data 16,-3,16,12,-32,-9,2,-2,-16,19,20,6
  200. Data 6,2,0,9,-12,-42,1,17,-49,10,36,-28
  201. Data 16,-4,26,25,20,24,24,8,0,23,70,2
  202. Data 20,-33,4,21,10,-10,22,74,-20,1,42,-12
  203.  
  204.  
  205. _FIGHT_START:
  206.  
  207.  
  208. _PL_1_X=50 : Rem This stores the X position of the fighter on screen
  209. _PL_1_Y=158 : Rem This stores the Y position of the fighter on screen
  210. _PL_1_ANIMATION=1 : Rem This stores the current animation or movement of the fighter 
  211. _PL_1_STATUS=1 : Rem This tells us what the fighter is doing at any time
  212. _PL_1_SPEED=8 : Rem This is the speed at which he moves around at
  213. _PL_1_ANIMATION_SPEED=3 : Rem This is the speed of his walking animations
  214.  
  215. ' ************** 
  216. ' * Fight Loop * 
  217. ' ************** 
  218.  
  219. _FIGHT_LOOP:
  220.  
  221. Gosub _PL_1_CHECKING : Rem This line jumps to the routine that does all of the checking for Player number 1 
  222.  
  223. ' *********************************************************************  
  224. ' * These four lines place the four different parts of the fighter on *  
  225. ' * the screen according to their different details stored in the     *
  226. ' * DIM and DATA statements. All I need to do to get a particular     *
  227. ' * fighting animation is call this routine and give is an ANIMATION  *
  228. ' * number to place on the screen.                                    *
  229. ' *********************************************************************
  230.  
  231. Bob 1,_PL_1_X+_PL_1_LEGS_X_OFFSET(_PL_1_ANIMATION),_PL_1_Y+_PL_1_LEGS_Y_OFFSET(_PL_1_ANIMATION),_PL_1_LEGS(_PL_1_ANIMATION)
  232. Bob 2,_PL_1_X+_PL_1_BODY_X_OFFSET(_PL_1_ANIMATION),_PL_1_Y+_PL_1_BODY_Y_OFFSET(_PL_1_ANIMATION),_PL_1_BODY(_PL_1_ANIMATION)
  233. Bob 3,_PL_1_X+_PL_1_HEAD_X_OFFSET(_PL_1_ANIMATION),_PL_1_Y+_PL_1_HEAD_Y_OFFSET(_PL_1_ANIMATION),_PL_1_HEAD(_PL_1_ANIMATION)
  234. Bob 4,_PL_1_X+_PL_1_HIT_PART_X_OFFSET(_PL_1_ANIMATION),_PL_1_Y+_PL_1_HIT_PART_Y_OFFSET(_PL_1_ANIMATION),_PL_1_HIT_PART(_PL_1_ANIMATION)
  235.  
  236. Update : Wait Vbl : Rem This line will place ALL our bobs on the screen in their latest positions
  237.  
  238. Goto _FIGHT_LOOP
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247. ' *******************************************************
  248. ' * This is where ALL of the fighters checking is done. *  
  249. ' *******************************************************  
  250.  
  251.  
  252. _PL_1_CHECKING:
  253.  
  254. _MOVING=0 : Rem Tells is used to tell us if the fighter has moved or not!  
  255.  
  256. ' ****************************************************************** 
  257. ' * When the joystick is pushed up we have to check if it has been * 
  258. ' * pushed left or right as well. If it has then we must jump to   * 
  259. ' * the appropriate routine.                                       * 
  260. ' ****************************************************************** 
  261.  
  262. If _PL_1_JUMPING>0
  263.  
  264. If _PL_1_JUMPING=1 : Gosub _JUMPING_UP : End If : Rem Has the fighter just jumped up in a straight line? 
  265. If _PL_1_JUMPING=2 : Gosub _JUMPING_UP_AND_LEFT : End If : Rem Has the fighter jumped up to the left? 
  266. If _PL_1_JUMPING=3 : Gosub _JUMPING_UP_AND_RIGHT : End If : Rem Has the fighter jumped up to the right?
  267. If _PL_1_JUMPING=4 : Gosub _SPECIAL_MOVE : End If : Rem This line is only used for speed reasons. It controls the SPECIAL move and has nothing to do with jumping! 
  268.  
  269. Return 
  270.  
  271. End If 
  272.  
  273.  
  274.  
  275.  
  276.  
  277. ' ************************************************************************ 
  278. ' * When a hit movement has been carried out we need to keep it on the   * 
  279. ' * screen for a while to get the full effect so this bit causes a delay * 
  280. ' * before it allows the fighter to do any more movements.               * 
  281. ' ************************************************************************ 
  282.  
  283. If _HIT_MOVEMENT=1 : Rem Is the fighter currently carring out a HIT movement? 
  284.  
  285. Inc _HIT_TIMER : Rem This controls a time delay 
  286.  
  287. If _HIT_TIMER>5 : Rem Has then delay been reached? 
  288.  
  289. ' *******************************************************
  290. ' * If it has then clear all the appropriate variables. *
  291. ' *******************************************************
  292.  
  293. _HIT_TIMER=0
  294. _HIT_MOVEMENT=0
  295. _HIT_CLEAR_COUNTER=0 : Rem This is used to control another delay in the fighter so that there is a delay between hit movements  
  296.  
  297. End If 
  298.  
  299. Return 
  300.  
  301. End If 
  302.  
  303.  
  304. Inc _HIT_CLEAR_COUNTER : Rem Used to control a delay between HIT movements
  305.  
  306.  
  307.  
  308.  
  309. ' ***********************************************
  310. ' * Has the joystick been pressed to the right? *
  311. ' ***********************************************
  312.  
  313. If Jright(1)
  314.  
  315.  
  316. If Fire(1) : Rem Has FIRE been pressed? 
  317.  
  318. If _PL_1_STATUS=1 : Rem Is the player currently standing or walking? 
  319.  
  320. If _HIT_CLEAR_COUNTER>5 : Rem Is it ok to carry out a HIT movement?
  321.  
  322. ' *************************************
  323. ' * This controls the standing punch! *  
  324. ' *************************************
  325.  
  326. _HIT_MOVEMENT=1 : Rem Tell the program that its carrying out a HIT movement
  327. _PL_1_ANIMATION=8 : Rem Tell the program what animation to show
  328. _MOVING=1 : Rem Tell the program it has moved in this loop 
  329.  
  330. Return : Rem Return 
  331.  
  332. End If 
  333.  
  334. End If 
  335.  
  336. End If 
  337.  
  338.  
  339.  
  340. If _PL_1_X<280 : Rem Is the fighters X coardinates inside the screen? 
  341.  
  342. If _PL_1_STATUS=1 : Rem Is he currently standing or walking
  343.  
  344. Add _PL_1_ANIMATION_SPEED_COUNTER,1,1 To _PL_1_ANIMATION_SPEED : Rem This controls his walking animation speed
  345.  
  346. ' *****************************************
  347. ' * This controls the walking animations. *
  348. ' *****************************************
  349.  
  350. If _PL_1_ANIMATION_SPEED_COUNTER=_PL_1_ANIMATION_SPEED
  351. Add _PL_1_ANIMATION,1,1 To 2
  352. End If 
  353.  
  354. _PL_1_X=_PL_1_X+_PL_1_SPEED : Rem Move him across the screen!
  355. _MOVING=1 : Rem Tell the program he is moving! 
  356.  
  357. End If 
  358.  
  359. End If 
  360.  
  361. End If 
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370. ' ********************************************** 
  371. ' * Has the joystick been pressed to the left? * 
  372. ' ********************************************** 
  373.  
  374. If Jleft(1)
  375.  
  376.  
  377. If Fire(1) : Rem Has FIRE been pressed
  378.  
  379. If _PL_1_STATUS=1 : Rem Is the fighter currently standing or walking?
  380.  
  381. If _HIT_CLEAR_COUNTER>5 : Rem Is it OK to carry out a HIT movement?
  382.  
  383. ' *******************************
  384. ' * This controls the SIDEKICK! *  
  385. ' *******************************
  386.  
  387. _HIT_MOVEMENT=1 : Rem Tell the program that its carrying out a HIT movement
  388. _PL_1_ANIMATION=7 : Rem Tell the program what animation to show
  389. _MOVING=1 : Rem Tell the program it has moved in this loop 
  390.  
  391. Return : Rem Return 
  392.  
  393. End If 
  394.  
  395. End If 
  396.  
  397. End If 
  398.  
  399.  
  400.  
  401. If _PL_1_X>10 : Rem Is the fighter inside the screen?
  402.  
  403. If _PL_1_STATUS=1 : Rem Is he currently walking or standing? 
  404.  
  405. Add _PL_1_ANIMATION_SPEED_COUNTER,1,1 To _PL_1_ANIMATION_SPEED : Rem This controls his walking animation speed
  406.  
  407. ' *****************************************
  408. ' * This controls the walking animations. *
  409. ' *****************************************
  410.  
  411. If _PL_1_ANIMATION_SPEED_COUNTER=_PL_1_ANIMATION_SPEED
  412. Add _PL_1_ANIMATION,1,1 To 2
  413. End If 
  414.  
  415. _PL_1_X=_PL_1_X-_PL_1_SPEED : Rem Move him across the screen!
  416. _MOVING=1 : Rem Tell the program he is moving! 
  417.  
  418.  
  419. End If 
  420.  
  421. End If 
  422.  
  423. End If 
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434. ' *************************************
  435. ' * Has the JOYSTICK been pressed up? *
  436. ' *************************************
  437.  
  438.  
  439. If Jup(1)
  440.  
  441. _JUMPING=1 : Rem Tell the program that he is jumping
  442.  
  443. _PL_1_ANIMATION=1 : Rem Make sure he is standing still before he jumps 
  444.  
  445. If Jright(1)
  446. _PL_1_JUMPING=3 : Rem Tell the routine to make Player 1 to jump to the right 
  447. Return 
  448. End If 
  449.  
  450. If Jleft(1)
  451. _PL_1_JUMPING=2 : Rem Tell the routine to make Player 1 jump to the left 
  452. Return 
  453. End If 
  454.  
  455. _PL_1_JUMPING=1 : Rem Tell the routine to make Player 1 jump up straight 
  456. Return 
  457.  
  458. End If 
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465. ' ***************************************
  466. ' * Has the JOYSTICK been pressed down? *
  467. ' ***************************************
  468.  
  469. If Jdown(1)
  470.  
  471. _MOVING=1 : Rem Tell the program he is moving
  472.  
  473. ' *********************************************************************
  474. ' * Has the joystick been press right and fire when down and is it ok *
  475. ' * to carry out a hit movement?                                      *
  476. ' *********************************************************************  
  477.  
  478. If Fire(1) and Jright(1) and _HIT_CLEAR_COUNTER>5
  479.  
  480. ' *********************************
  481. ' * This carrys out the HEADBUTT! *
  482. ' *********************************
  483.  
  484. _HIT_MOVEMENT=1 : Rem Tell the program it is carrying out a HIT movement 
  485. _PL_1_STATUS=2 : Rem Tell the program it is ducking 
  486. _PL_1_ANIMATION=13 : Rem Show the animation 
  487.  
  488. Return 
  489.  
  490. End If 
  491.  
  492.  
  493.  
  494.  
  495.  
  496. ' ************************** 
  497. ' * Has FIRE been pressed? * 
  498. ' ************************** 
  499.  
  500. If Fire(1)
  501.  
  502. If Not Jleft(1) and Not Jright(1) : Rem Make sure the joystick has'nt been pressed to the left or right
  503.  
  504. If _HIT_CLEAR_COUNTER>5 : Rem Can we do a HIT movement?
  505.  
  506. ' ************************** 
  507. ' * This does the LOW KICK * 
  508. ' ************************** 
  509.  
  510. _HIT_MOVEMENT=1 : Rem Tell the program we're doing a HIT movemnt 
  511. _PL_1_STATUS=2 : Rem Tell it we are ducking 
  512. _PL_1_ANIMATION=4 : Rem Show animation number 4
  513.  
  514. Return 
  515.  
  516. End If 
  517.  
  518. End If 
  519.  
  520. End If 
  521.  
  522.  
  523. ' ************************************************ 
  524. ' * This is used for the duck blocking animation * 
  525. ' ************************************************ 
  526.  
  527. If Jleft(1) and Not Fire(1) : Rem Have you pressed left and NOT pressed fire?
  528.  
  529. _PL_1_STATUS=2 : Rem Tell the program we are ducking
  530. _PL_1_ANIMATION=5 : Rem Show animation number 5
  531.  
  532. Return 
  533.  
  534. End If 
  535.  
  536.  
  537. ' *************************************************
  538. ' * This controls the duck punching hit movement. *
  539. ' *************************************************
  540.  
  541. If Jleft(1) and Fire(1) and _HIT_CLEAR_COUNTER>5 : Rem Has left and fire been pressed and can we do a HIT movement? 
  542.  
  543. _HIT_MOVEMENT=1 : Rem Tell the program we are doing a HIT movement!
  544. _PL_1_STATUS=2 : Rem Tell the program we are ducking  
  545. _PL_1_ANIMATION=6 : Rem Show animation number 6  
  546.  
  547. Return 
  548.  
  549. End If 
  550.  
  551.  
  552.  
  553. ' *********************************************************************  
  554. ' * If no direction has been pushed except JDOWN on its own then just *
  555. ' * show the fighter ducking.                                         *
  556. ' *********************************************************************  
  557.  
  558. If(_PL_1_STATUS=1 or _PL_1_STATUS=2)
  559.  
  560. _PL_1_STATUS=2
  561. _PL_1_ANIMATION=3
  562.  
  563. Return 
  564.  
  565. End If 
  566.  
  567. Else 
  568.  
  569. ' ***********************************************************************
  570. ' * If the joystick is let go then we need to make the fighter stand up *
  571. ' * again.                                                              *
  572. ' ***********************************************************************
  573.  
  574. If _PL_1_STATUS=2 : Rem Is he already ducking? 
  575.  
  576. _PL_1_STATUS=1 : Rem Tell the program he is now standing
  577. _PL_1_ANIMATION=1 : Rem Show the standing animation
  578.  
  579. Return : Rem Return!
  580.  
  581. End If 
  582.  
  583. End If 
  584.  
  585.  
  586.  
  587.  
  588. ' *******************************************************************
  589. ' * This next bit controls our fighter standing still without doing *
  590. ' * any movements. It also checkings for FIRE being held down so    *
  591. ' * that he does a special movement!                                *
  592. ' *******************************************************************
  593.  
  594. If _MOVING=0 : Rem Has he moved? - No!
  595.  
  596. _PL_1_ANIMATION=1 : Rem Show him standing! 
  597.  
  598. ' *********************************************************
  599. ' * This is the bit that checks for FIRE being held down! *
  600. ' *********************************************************
  601.  
  602. If Fire(1) : Rem Has fire been pressed? 
  603.  
  604. Inc _SPECIAL_MOVE_COUNTER : Rem Start couting how many times 
  605.  
  606. Else 
  607.  
  608. _SPECIAL_MOVE_COUNTER=0 : Rem Fire has not been held down so reset the counter!
  609.  
  610. End If 
  611.  
  612.  
  613. ' ****************************************** 
  614. ' * This part checks for the SPECIAL MOVE. *   
  615. ' ****************************************** 
  616.  
  617.  
  618. If _SPECIAL_MOVE_COUNTER=10 : Rem Has FIRE been held down for 10 VBL's 
  619.  
  620. _PL_1_JUMPING=4 : Rem This is used to tell the program that a SPECIAL MOVE is being carried out - I have just used the jumping variable to tell the program this!
  621.  
  622. _SPECIAL_MOVE_COUNTER=0 : Rem Reset the counter
  623.  
  624. End If 
  625.  
  626. End If 
  627.  
  628. Return 
  629.  
  630.  
  631.  
  632.  
  633. ' *****************************************************************
  634. ' * This bit controls the fighter JUMPING UP straight in the air! *
  635. ' *****************************************************************
  636.  
  637.  
  638. _JUMPING_UP:
  639.  
  640.  
  641. If _PL_1_ANIMATION<>10 : Rem This controls the KICKING in the air bit!
  642. _PL_1_ANIMATION=9
  643. End If 
  644.  
  645. If _JUMPING=1 : Rem Is the fighter currently moving UP!
  646.  
  647. ' ************************** 
  648. ' * Has fire been pressed? * 
  649. ' ************************** 
  650.  
  651. If Fire(1)
  652. _PL_1_ANIMATION=10 : Rem Show the kicking animation 
  653. End If 
  654.  
  655. _PL_1_Y=_PL_1_Y-_PL_1_SPEED*1.5 : Rem Move him up the screen 
  656.  
  657. ' *********************************************************************
  658. ' * Once he reaches the TOP of the screen we just tell the program to *
  659. ' * start moving him down again by setting _JUMPING to 0.             *
  660. ' *********************************************************************
  661.  
  662. If _PL_1_Y<0 : Rem Reached the top of the screen? 
  663. _JUMPING=0
  664. End If 
  665.  
  666. End If 
  667.  
  668.  
  669. ' *****************************************************  
  670. ' * This bit controls the fighter falling down again! *
  671. ' *****************************************************
  672.  
  673. If _JUMPING=0
  674.  
  675. _PL_1_Y=_PL_1_Y+_PL_1_SPEED*1.5
  676.  
  677.  
  678. If _PL_1_Y=158 : Rem Has he reached the ground? 
  679.  
  680. _JUMPING=0 : Rem Tell the program that all jumping has stopped
  681. _PL_1_JUMPING=0 : Rem Clear this variable
  682. _PL_1_ANIMATION=1 : Rem Place the fighters stance animation on screen
  683.  
  684. End If 
  685.  
  686. End If 
  687.  
  688. Return 
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699. _JUMPING_UP_AND_LEFT:
  700.  
  701.  
  702. If _PL_1_ANIMATION<>12 : Rem This controls the kicking in the jump
  703. _PL_1_ANIMATION=9
  704. End If 
  705.  
  706.  
  707. If _JUMPING=1 : Rem Is the fighter currently moving up?
  708.  
  709. ' *******************************************************  
  710. ' * If you have pressed FIRE then show the FLYING PUNCH *  
  711. ' *******************************************************  
  712.  
  713. If Fire(1)
  714. _PL_1_ANIMATION=12 : Rem Show FLYING PUNCH  
  715. End If 
  716.  
  717. _PL_1_Y=_PL_1_Y-_PL_1_SPEED*1.5 : Rem Move him UP the screen 
  718.  
  719. If _PL_1_X>0
  720. _PL_1_X=_PL_1_X-_PL_1_SPEED : Rem If his X coardiantes are greater than 0 then move him to the left
  721. End If 
  722.  
  723. If _PL_1_Y<20 : Rem Once his Y coardiantes have reached 20 then we start moving him back down again
  724. _JUMPING=0
  725. Wait Vbl 
  726. End If 
  727.  
  728. End If 
  729.  
  730.  
  731. If _JUMPING=0 : Rem Is he now falling? 
  732.  
  733. _PL_1_Y=_PL_1_Y+_PL_1_SPEED*1.5 : Rem Start moving him down
  734.  
  735. If _PL_1_X>0
  736. _PL_1_X=_PL_1_X-_PL_1_SPEED : Rem If his X coardinates are greater than 0 then move him to the left  
  737. End If 
  738.  
  739.  
  740. If _PL_1_Y=158 : Rem Has his Y coardinates reached the ground yet?
  741. _JUMPING=0 : Rem Clear jumping
  742. _PL_1_JUMPING=0
  743. _PL_1_ANIMATION=1 : Rem Place the fighters stance animation on the screen
  744. End If 
  745.  
  746. End If 
  747.  
  748. Return 
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757. _JUMPING_UP_AND_RIGHT:
  758.  
  759.  
  760. If _PL_1_ANIMATION<>11 : Rem  This controls the FLYING KICK in air
  761. _PL_1_ANIMATION=9
  762. End If 
  763.  
  764. If _JUMPING=1 : Rem Is the fighter currently moving UP the screen? 
  765.  
  766. ' ***********************************************************
  767. ' * If FIRE is pressed then show the FLYING KICK animation! *
  768. ' ***********************************************************  
  769.  
  770. If Fire(1)
  771. _PL_1_ANIMATION=11 : Rem Show flying kick 
  772. End If 
  773.  
  774. _PL_1_Y=_PL_1_Y-_PL_1_SPEED*1.5 : Rem Move him UP the screen 
  775.  
  776. If _PL_1_X<280
  777. _PL_1_X=_PL_1_X+_PL_1_SPEED : Rem If his X coardinates are less than 280 then move him to the right
  778. End If 
  779.  
  780. If _PL_1_Y<20 : Rem Has he reached the TOP of the screen yet?
  781. _JUMPING=0 : Rem Tell the program to make him start falling!  
  782. Wait Vbl : Rem A slight PAUSE!
  783. End If 
  784.  
  785. End If 
  786.  
  787.  
  788. ' *******************************************
  789. ' * This controls him falling to the right! *
  790. ' *******************************************
  791.  
  792. If _JUMPING=0
  793.  
  794. _PL_1_Y=_PL_1_Y+_PL_1_SPEED*1.5 : Rem Move him down the screen 
  795.  
  796. If _PL_1_X<280
  797. _PL_1_X=_PL_1_X+_PL_1_SPEED : Rem If his X coardinates are less than 280 then make him move to the right!  
  798. End If 
  799.  
  800.  
  801. If _PL_1_Y=158 : Rem Has he reached the ground yet? 
  802. _JUMPING=0
  803. _PL_1_JUMPING=0
  804. _PL_1_ANIMATION=1 : Rem Show the STANCE animation
  805. End If 
  806.  
  807. End If 
  808.  
  809. Return 
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821. ' ************************************************** 
  822. ' * This is the bit that controls the SPECIAL MOVE * 
  823. ' ************************************************** 
  824.  
  825.  
  826. _SPECIAL_MOVE:
  827.  
  828. _PL_1_ANIMATION=14 : Rem Show SPECIAL MOVE animation
  829.  
  830. Inc _SPECIAL_MOVE_MOVEMENT_COUNTER : Rem This is a timing counter 
  831.  
  832.  
  833. ' **************************************************** 
  834. ' * Is the fighters X coardinates inside the screen? * 
  835. ' **************************************************** 
  836.  
  837. If _PL_1_X<260
  838. _PL_1_X=_PL_1_X+_PL_1_SPEED*2 : Rem Move him accross the screen VERY FAST
  839. Else 
  840. _SPECIAL_MOVE_MOVEMENT_COUNTER=10 : Rem Otherwise END the SPECIAL MOVE 
  841. End If 
  842.  
  843. ' *************************************************************
  844. ' * Once the SPECIAL MOVE has been on the screen for 10 VBL's *
  845. ' * we need to turn it off.                                   *
  846. ' *************************************************************
  847.  
  848. If _SPECIAL_MOVE_MOVEMENT_COUNTER=10
  849.  
  850. _SPECIAL_MOVE_MOVEMENT_COUNTER=0
  851. _PL_1_ANIMATION=1 : Rem Show the fighters stance animation 
  852. _PL_1_JUMPING=0
  853. _MOVING=0 : Rem Tell the program that ALL moving has finished
  854.  
  855. End If 
  856.  
  857. Return